package com.ctgu.蓝桥杯真题.B组2016;

import java.io.*;

/**
 * @author: Backdiy
 * @data: 2021/4/14 15:39
 * @desc:
 */
public class B生日蜡烛 {
    public static void main(String[] args) throws IOException {
        int sum = IO.nextInt();
        int c = 1;
        for (int i = 2; i < 100; i++) {
            int t = i * (i - 1) / 2;
            if ((sum - t) % i == 0) {
                c = (sum - t) / i;
                IO.out.println(c);
                break;
            }
        }
        IO.out.flush();
    }

    static class IO {
        static StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
        static BufferedReader read = new BufferedReader(new InputStreamReader(System.in));
        static PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));

        static public int nextInt() throws IOException {
            in.nextToken();
            return (int) in.nval;
        }

        static public double nextDouble() throws IOException {
            in.nextToken();
            return in.nval;
        }

        static public String readLine() throws IOException {
            return read.readLine();
        }

        static public String nextLine() throws IOException {
            in.nextToken();
            return in.sval;
        }
    }
}
